package com.mitake.parse;

import com.mitake.parse.MonthK.MonthKItem;
import com.mitake.utils.ParseUtil;

public class MitakeMonthK {
	
	public static MonthK parseMonthK(String src){
		MonthK monthK =new MonthK();
			String [] block03 = src.split(ParseUtil.SPLIT_0x03);
			for(int j=0; j<block03.length; j++){
				String[] block02 = block03[j].split(ParseUtil.SPLIT_0x02);
				MonthKItem monthKItem =new MonthKItem();
				monthKItem.date = ParseUtil.base93.getDecodeNumber(block02[0]);
				monthKItem.time = ParseUtil.base93.getDecodeNumber(block02[1]);
				monthKItem.firstPrice = ParseUtil.base93.getDecodeNumber(block02[2]);
				monthKItem.highPrice =  ParseUtil.base93.getDecodeNumber(block02[3]);
				monthKItem.lowPrice =   ParseUtil.base93.getDecodeNumber(block02[4]);
				monthKItem.lastPrice =  ParseUtil.base93.getDecodeNumber(block02[5]);
				monthKItem.volume =     ParseUtil.base93.getDecodeNumber(block02[6]);
				monthKItem.reference =  ParseUtil.base93.getDecodeNumber(block02[7]);
				monthK.monthKMap.put(monthKItem.date, monthKItem);
			} 
			return monthK;
	}
	
}
